package com.company.gas.service.impl;


import com.company.gas.mapper.GasBaseMapper;
import com.company.gas.pojo.GasBase;
import com.company.gas.service.IGasBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class GasBaseServiceImpl implements IGasBaseService {
    @Autowired
    private GasBaseMapper gasBaseMapper;

    //查询全部燃气库
    @Override
    public List<GasBase> queryGasBaseList(){
        return gasBaseMapper.queryGasBaseList();
    }
    //按ID查询燃气库
    @Override
    public GasBase queryGasBaseByID(String baseId){
        GasBase gasBase = gasBaseMapper.queryGasBaseByID(baseId);
        return gasBase;
    }
    //添加燃气库
    @Override
    public int addGasBase(String baseId, BigDecimal gasStore, String baseAdr, Boolean flag, String createBy, String modifyBy) {
        gasBaseMapper.addGasBase(baseId, gasStore, baseAdr, flag, createBy, modifyBy);
        return 1;
    }

    @Override
    public int updateGasBase(String baseId, BigDecimal gasStore, String baseAdr, String modifyBy) {
        gasBaseMapper.updateGasBase(baseId,gasStore,baseAdr,modifyBy);
        return  1;
    }

    //删除燃气库
    @Override
    public int deleteGasBaseByID(String baseId){
        gasBaseMapper.deleteGasBaseByID(baseId);
        return 1;
    }

}
